from dotenv import load_dotenv
from pydantic import BaseSettings
from os import getenv

load_dotenv()

class AppConfig(BaseSettings):
    """
    环境变量配置类
    """
    HOST: str = getenv("HOST", "0.0.0.0")
    PORT: int = int(getenv("PORT", 8000))
    VITE_HMR: bool = getenv("VITE_HMR", "false").lower() == "true"
    FASTAPI_RELOAD: bool = getenv("FASTAPI_RELOAD", "false").lower() == "true"
    FASTAPI_DOC: bool = getenv("FASTAPI_DOC", "false").lower() == "true"
    JWT_SECRET_KEY: str = getenv("JWT_SECRET_KEY", "your-secret-key")
    JWT_REFRESH_SECRET_KEY: str = getenv("JWT_REFRESH_SECRET_KEY", "your-refresh-secret-key")
    JWT_ALGORITHM: str = getenv("JWT_ALGORITHM", "HS256")

appConfig = AppConfig()